'use strict';

const Service = require('egg').Service

class ActionTokenService extends Service {
  async apply(param) {
    const {ctx,app,service} = this;
    return app.jwt.sign({
      data: param ,
      exp: Math.floor(Date.now() / 1000) + (60 * 60 * 24 * 7)
    }, app.config.jwt.secret)
  }
}

module.exports = ActionTokenService;
